package it.unicam.cs.cosy.bioshape.core.perception;

import java.io.Serializable;

/**
 * Defines a perception sphere, i.e. a generic spatial sphere representing
 * 
 * @author Carmine
 * 
 */
public class SpherePerception implements Perception, Serializable {

	private static final long serialVersionUID = -4738423800530846227L;
	private double radius;

	/**
	 * Generates the perception sphere
	 * 
	 * @param radius
	 *            The radius of the sphere
	 */
	public SpherePerception(double radius) {
		this.radius = radius;
	}

	@Override
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof SpherePerception))
			return false;
		return this.radius == ((SpherePerception) other).radius;
	}

	// TODO come detto nell'interfaccia questo metodo deve tornare altro!!
	@Override
	public double getPerceptionArea(double center) {
		return 0;
	}

	/**
	 * Metodo get per ottenere il raggio della sfera
	 * 
	 * @return il raggio
	 */
	@Override
	public double getRadius() {
		return radius;
	}

	@Override
	/* TODO unused --> change it if needed */
	public int hashCode() {
		return super.hashCode();
	}

	@Override
	public void setRadius(double radius) {
		this.radius = radius;
	}
}
